//
//  SDCityModel.m
//  SuperDoctor
//
//  Created by 李忠 on 7/6/16.
//  Copyright © 2016 SD. All rights reserved.
//

#import "SDCityModel.h"

@implementation SDCityModel

- (instancetype)initWithDict:(NSDictionary *)dict{
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}
+ (instancetype)cityWithDict:(NSDictionary *)dict{
    return [[self alloc] initWithDict:dict];
}


+ (NSArray *)getArrModel{
    
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"province.plist" ofType:nil];
    NSArray *array = [NSArray arrayWithContentsOfFile:filePath];
    NSMutableArray *arrM = [NSMutableArray array];
    
    [array enumerateObjectsUsingBlock:^(NSDictionary *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        SDCityModel *model = [SDCityModel cityWithDict:obj];
        [arrM addObject:model];
    }];
    
    return arrM.copy;
}
@end
